package com.carter.springframework.context.support;

import com.carter.springframework.beans.factory.support.DefaultListableBeanFactory;
import com.carter.springframework.beans.factory.xml.XmlBeanDefinitionReader;

public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext{
    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory){
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory, this);
        String[] configLocations = getConfigLocations();
        if (null != configLocations) {
            reader.loadBeanDefinitions(configLocations);
        }
    }

    /**
     * 获取配置文件的路径
     * @return
     */
    protected abstract String[] getConfigLocations();
}
